<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>111</title>
</head>

<body>
<?php

function getRev($str,$encoding='utf-8'){
	$len=mb_strlen($str,$encoding);
	$result='';
	echo "len is $len </br>";
	for ($i=$len-1;$i>=0;$i--){
		$result.=mb_substr($str, $i,1,$encoding);
	}
	return $result;
}
$str="xc我好了";
echo "$str 翻转: ".getRev($str)."</br>";
?>
</body>
</html>